package api

import (
	"26day12/api/handlers"
	"26day12/api/middleware"
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
)

func LoadRouter(r *gin.Engine) {
	r.Use(middleware.DoeM())
	user := r.Group("/user")
	{
		user.POST("/register", handlers.Register)
		user.POST("/login", handlers.Login)
		user.Use(jwt.JWTAuth("2209a"))
		user.GET("/chat", handlers.Chat)
		user.GET("/list", handlers.List)
	}
}
